Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the pull request
The problem in question is described in this report: cmss13-devs/cmss13#4777
First issue is the interior spaces were not being detected as interiors. For instance, deployables were supposed to be blocked from deploying in interiors. They were being blocked, but not because it was an interior: they were blocked by the turfs themselves being marked as not buildable. Instead of the
It's too cramped in here to deploy ...
message, you'd getYou can't set up ... here
. The cause was theinterior
subsystem populating theused_turfs
with weakrefs to a specific type, thenin_interior()
checking if that list returned that specific type. It didn't, because weakrefs to a type aren't that type: oldFixed by checking for weakrefs instead: new
Second issue exposed by fixing the first: the
used_turfs
list could contain turfs that weren't in an interior. Not an issue in most cases, but the sound system would check if a turf was in an interior then check which interior index it was.get_interior_by_coords()
failed to find an interior and returnedFALSE
, which is equivalent to0
and the sound system used that as the index and errored out: oldFixed by returning
null
on failure instead: newThird is the audio was now playing, but only in part of the interior. The interior's center wasn't being calculated correctly, and was being pinned in the top right corner: old
Fixed by correctly averaging the positions of the corners: new
Finally, the interior's dimensions were flipped, assigning the height to width and vice-versa: old
Corrected here: new
Explain why it's good for the game
Vehicle interiors being able to hear their own gunfire, movement sounds, as well as external fighting is cool and good.
Testing Photographs and Procedure
Screenshots & Videos
Put screenshots and videos here with an empty line between the screenshots and the
<details>
tags.Changelog
🆑
fix: vehicle interiors can hear exterior noises
/:cl: